function formCheck(obj, objName){
	if( obj.value == "" ){
		alert(objName+"不能为空！");

		return false;
	}else{
		return true;
	}
}

/* 登录按钮表单验证开始 */
var formObj = $("","form")[0];
formObj.onsubmit = function(){ //提交时表单验证
	if( !(formCheck($("#","username"),"用户名")
		&& formCheck($("#","password"),"密码")) ){
		return false;
	}
}
/* 登录按钮表单验证结束 */

/* 失去焦点表单验证开始 */
var usernameObj = $("#","username");
usernameObj.onblur = function(){
	formCheck($("#","username"),"用户名");
}

var passwordObj = $("#","password");
passwordObj.onblur = function(){
	formCheck($("#","password"),"密码");
}
/* 失去焦点表单验证结束 */